home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / tcpdump-.7 / tcpdump- / tcpdump-richard-1.7 / linux-include / protocols / routed.h
Encoding:
C/C++ Source or Header  |  1994-06-30  |  2.2 KB  |  83 lines

  1. /*      @(#)routed.h 1.9 88/08/19 SMI; from UCB 5.1 6/4/85    */
  2. /*
  3.  * Copyright (c) 1983 Regents of the University of California.
  4.  * All rights reserved.  The Berkeley software License Agreement
  5.  * specifies the terms and conditions for redistribution.
  6.  */
  7.  
  8. /*
  9.  * Routing Information Protocol
  10.  *
  11.  * Derived from Xerox NS Routing Information Protocol
  12.  * by changing 32-bit net numbers to sockaddr's and
  13.  * padding stuff to 32-bit boundaries.
  14.  */
  15.  
  16. #ifndef _protocols_routed_h
  17. #define _protocols_routed_h
  18.  
  19. #define    RIPVERSION    1
  20.  
  21. struct netinfo {
  22.     struct    sockaddr rip_dst;    /* destination net/host */
  23.     int    rip_metric;        /* cost of route */
  24. };
  25.  
  26. struct rip {
  27.     u_char    rip_cmd;        /* request/response */
  28.     u_char    rip_vers;        /* protocol version # */
  29.     u_char    rip_res1[2];        /* pad to 32-bit boundary */
  30.     union {
  31.         struct    netinfo ru_nets[1];    /* variable length... */
  32.         char    ru_tracefile[1];    /* ditto ... */
  33.     } ripun;
  34. #define    rip_nets    ripun.ru_nets
  35. #define    rip_tracefile    ripun.ru_tracefile
  36. };
  37.  
  38. struct entryinfo {
  39.     struct    sockaddr rtu_dst;
  40.     struct    sockaddr rtu_router;
  41.     short    rtu_flags;
  42.     short    rtu_state;
  43.     int    rtu_timer;
  44.     int    rtu_metric;
  45.     int    int_flags;
  46.     char    int_name[16];
  47. };
  48.  
  49. /*
  50.  * Packet types.
  51.  */
  52. #define    RIPCMD_REQUEST        1    /* want info - from suppliers */
  53. #define    RIPCMD_RESPONSE        2    /* responding to request */
  54. #define    RIPCMD_TRACEON        3    /* turn tracing on */
  55. #define    RIPCMD_TRACEOFF        4    /* turn it off */
  56. #define    RIPCMD_POLL        5    /* like request, but anyone answers */
  57. #define    RIPCMD_POLLENTRY    6    /* like poll, but for entire entry */
  58.  
  59. #define    RIPCMD_MAX        7
  60. #ifdef RIPCMDS
  61. char *ripcmds[RIPCMD_MAX] =
  62.   { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF", "POLL", "POLLENTRY" };
  63. #endif
  64.  
  65. #define    HOPCNT_INFINITY        16    /* per Xerox NS */
  66. #define    MAXPACKETSIZE        512    /* max broadcast size */
  67.  
  68. /*
  69.  * Timer values used in managing the routing table.
  70.  * Every update forces an entry's timer to be reset.  After
  71.  * EXPIRE_TIME without updates, the entry is marked invalid,
  72.  * but held onto until GARBAGE_TIME so that others may
  73.  * see it "be deleted".
  74.  */
  75. #define    TIMER_RATE        30    /* alarm clocks every 30 seconds */
  76.  
  77. #define    SUPPLY_INTERVAL        30    /* time to supply tables */
  78.  
  79. #define    EXPIRE_TIME        180    /* time to mark entry invalid */
  80. #define    GARBAGE_TIME        240    /* time to garbage collect */
  81.  
  82. #endif /*!_protocols_routed_h*/
  83.